const jwt = require('jsonwebtoken')
let signkey = "jwt" // 秘钥
//生成token
const setToken = (username, pwd) => {
    const rule = {
        username,
        pwd
    }
    let ztoken = jwt.sign(rule, signkey, {
        expiresIn: 60 * 60 * 48
    })
    return ztoken
}


module.exports  = setToken